public class Solution2185 {
    public int prefixCount(String[] words, String pref) {
        int count=0;
        for (String word : words) {
            if (word.indexOf(pref)==0){
                count++;
            }
        }
        return count;
    }

    public static void main(String[] args) {
        System.out.println(new Solution2185().prefixCount(new String[]{"pay","attention","practice","attend"},"at"));
    }
}
